package observermode;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/19 9:58
 */
public class OberverTest {
    public static void main(String[] args) {
        Teacher teacher = new Teacher("数学老师");
        Teacher teacher2 = new Teacher("语文老师");

        StudentObserver observer1 = new StudentObserver("张三");
        StudentObserver observer2 = new StudentObserver("李四");
        StudentObserver observer3 = new StudentObserver("王五");
        StudentObserver observer4 = new StudentObserver("赵六");

        observer1.addObservable(teacher);
        observer1.addObservable(teacher2);
        observer2.addObservable(teacher);
        observer3.addObservable(teacher2);
        observer4.addObservable(teacher);
        observer4.addObservable(teacher2);

        teacher.setHomework("第1题");
        teacher.setHomework("第3题");
        teacher2.setHomework("第4题");
        teacher2.setHomework("第6题");

        Integer.getInteger("1");
    }
}
